home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr49
/
352_01.zip
/
VECZSUB.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-04-10
|
1KB
|
62 lines
//////// COMPLEX VECTORS
//
// primary subroutines to support complex vector math :
// subtraction.
//
#include <stdlib.h>
#include <alloc.h>
#include <string.h>
#include "wtwg.h"
#include "dblib.h"
#include "vector.h"
CVector& CVector::operator-=(CVector& z)
// subtract CVector z from CVector this.
{
if ( ispolar || z.ispolar ) werror ( 'V', "ADDING POLAR VECTORS" );
x -= z.x;
y -= z.y;
return *this;
}
CVector& CVector::operator-=(complex z)
// Subtract complex z from CVector this
{
if ( ispolar ) werror ( 'V', "ADDING POLAR VECTORS" );
x -= real (z);
y -= imag (z);
return *this;
}
CVector& CVector::operator-=(Vector& vec)
// subtract real Vector vec from CVector this.
{
if ( ispolar ) werror ( 'V', "ADDING POLAR VECTORS" );
x -= vec;
return *this;
}
CVector& CVector::operator-=(float f)
// Subtract float f from CVector this
{
if ( ispolar ) werror ( 'V', "ADDING POLAR VECTORS" );
x -= f;
return *this;
}
//---------------------end VECZSUB.CPP -----------------------------